package Test1;

import java.util.Objects;

public class Demo1 {
    public static void main(String[] args) {
        Student s1 = null;
        Student s2 = new Student("zhangsan",14);

        //Objects.equals():先做非空判断，比较两个对象
        //isNull():判断是否为空
        //nonNull():判断是否为空,跟isNull结果相反

        System.out.println(Objects.equals(s1,s2));
        System.out.println(Objects.isNull(s1));
        System.out.println(Objects.nonNull(s1));
    }
}
